package com.java2007.controller.front;

import com.java2007.controller.BaseServlet;
import com.java2007.factory.BeanFactory;
import com.java2007.pojo.Table;
import com.java2007.service.TableService;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 前端页面处理层
 */
@WebServlet("/login")
public class FrontController extends BaseServlet {
    TableService tableService= (TableService) BeanFactory.getBean("com.java2007.service.impl.TableServiceImpl");

    /**
     * 查询所以没有预约的餐桌
     * @param request
     * @param response
     * @return
     */
    public String findAll(HttpServletRequest request, HttpServletResponse response) throws Exception{
            List<Table> fTables = tableService.queryAlliDle();
            request.setAttribute("fTables",fTables);
            return "forward:front/index.jsp";
    }



}
